const app = getApp()
var score=''//用户数据信息
var id=''//用户id
Page({
  data: {
    userid :'',
        show_the_picture: 'http://img.mp.itc.cn/upload/20170720/0fa1a67355e54fe09808cb679276646a_th.jpg'
  },
  onLoad: function (e,option) {
    var that = this
    //获取用户信息
    wx.getStorage({
      key: 'userid',
      success: function(res) {
        that.setData({
          userid:res.data
        })
        //console.log(that.data.userid)
        //赋值
        id = that.data.userid
        //console.log('========='+id)
      },
    })
    //获取用户头像，昵称
    wx.getUserInfo({
       success: function (re) {
         that.setData({
            nickName: re.userInfo.nickName,
            avatarUrl: re.userInfo.avatarUrl,
         })
         //console.log(re.userInfo.nickName);
         //获取用户成绩
         wx.request({
           url: 'http://10.20.58.235:8080/v1/open/information/manager/summary/%7Bid%7D?id=' + id,
           method: 'GET',
           header: {
             'content-type': 'application/json;charset=UTF-8',
           },
           success: function (res) {
             that.setData({
               score: res
             })
             //console.log(res)
           }
         })
       }
     }) 
  },
  jump:function(){
    wx.navigateTo({
      url: '../problem/problem',
    })
  },
  selectjump(){
    // wx.navigateTo({
    //   url: '',
    // })
    wx.showModal({
      title: '',
      content: '功能开发中...',
      showCancel:false
    })
  }
})
